﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace blackhouse.WebNemo.Business.Groups {
    public interface IGroup {

        int Id { get; }
        string Identyficator { get; set; }
        string Name { get; set; }
        string SystemName { get; }
        bool Exists { get; }
        GroupColumnCollection Columns { get; }
        string SelectTable { get; }
        GroupType Type { get; }
        bool EnableTranslate { get; set; }
        bool ReadOnly { get; set; }

        void Save();
        void Delete();
        IGroupRecord[] GetGroupRecords(CultureInfo language);
        IGroupRecord[] GetGroupRecords(GroupRecordQuery query, CultureInfo language);
        IGroupRecord GetGroupRecord(int recordId, CultureInfo language);

        /// <summary>
        /// Pobiera rekordy będące w relacji.
        /// </summary>
        /// <param name="groupId"></param>
        /// <param name="recordId"></param>
        /// <returns></returns>
        IGroupRecord[] GetRelatedGroupRecords(int groupId, string columnName, int recordId, CultureInfo language);
        void RemoveRelationToGroupRecord(int relRecordId, int parentGroupId, string parentColumnName, int parentRecordId);
        void AddRelationToGroupRecord(int relRecordId, int parentGroupId, string parentColumnName, int parentRecordId);

    }
}
